import matplotlib.pyplot as plt

def save_training_curve(episode_rewards, out_path: str):
    plt.figure(figsize=(8, 4))
    plt.plot(episode_rewards, label="Episode reward")
    plt.xlabel("Episode")
    plt.ylabel("Reward")
    plt.title("Training Reward Curve")
    plt.grid(True, alpha=0.3)
    plt.legend()
    plt.tight_layout()
    plt.savefig(out_path)
    plt.close()